<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h2 {
            text-align: center;
        }

        table,
        tr,
        td {
            border: 1px solid #000;
        }

        table {
            /* 合并相邻边框 */
            border-collapse: collapse;
            /* 元素居中 */
            margin: auto;
            text-align: center;
        }

        tr {

            padding: 5px 30px;
        }
    </style>
</head>

<body>
    <h2>订单确认</h2>

    <script>
        let price = +prompt('请输入价格')
        let num = +prompt('请输入数量')
        let a = prompt('请输入收货地址')
        let address = price * num
        document.write(`
        <table>
        <!-- tr 行 -->
        <tr> <!-- td 列 -->
            <td>商品名称</td>
            <td>商品价格</td>
            <td>商品数量</td>
            <td>总价</td>
            <td>收货地址</td>
        </tr>
        <tr>
            <td>小米手机</td>
            <td>${price}</td>
            <td>${num}</td>
            <td>${address}</td>
            <td>${a}</td>
        </tr>
    </table>
        `)
    </script>
</body>

</html>